package com.aliyun.oss.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")// 允许所有路径
                .allowedOrigins("*")// 允许所有来源/端口（或指定前端地址，如 "http://127.0.0.1:8848"）
                .allowedMethods("*");// 允许的HTTP方法
    }
}
